package com.yy.controller;

import base.CurrentUserUtils;
import cn.hutool.core.lang.UUID;
import com.yy.service.feign.VideoFeign;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import base.Result;

import java.util.HashMap;
import java.util.Map;

/**
 * @Author: lyy
 * Date: 2021/12/13 15:07
 */
@RequestMapping("/order")
@RestController
public class OrderController {

	@Autowired
	private VideoFeign videoFeign;

	@GetMapping("/find")
	public Result find(Integer orderId){
		Map<String, Object> order = new HashMap<>();
		order.put("orderId", UUID.randomUUID().toString());
		order.put("videoInfo", videoFeign.selectVideo(orderId).getData());
		order.put("user", CurrentUserUtils.getCurrentUser());
		return Result.ok(order);
	}

}
